SetAnyoneType
Sets the type of the "Anyone" user to the current protected range.
Syntax
expression.SetAnyoneType(protectedRangeUserType);
expression
- A variable that represents a ApiProtectedRange class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
protectedRangeUserType | Required | ProtectedRangeUserType | The user type of the protected range. |
Returns
bool
Example
This example changes the the user protected range.
var oWorksheet = Api.GetActiveSheet();
oWorksheet.AddProtectedRange("protectedRange", "Sheet1!$A$1:$B$1");
var protectedRange = oWorksheet.GetProtectedRange("protectedRange");
protectedRange.SetAnyoneType("CanView");